package com.ruoyi.common.enums;

public enum UserTagEnum {

    /**
     * 安装未注册
     */
    UN_REGISTERED("Unregistered"),

    /**
     * 用户完成注册但未申请身份验证
     */
    REGISTERED_NOT_VERIFIED("Registered", "Registered. Not verified"),

    /**
     * 用户完成注册，未设置密码
     */
    REGISTERED_NOT_PASSWORD("Registered", "Registered. No_password"),

    /**
     * 实名成功
     */
    IDENTITY_VERIFIED_SUCCESS("Identity Verified success. Un-applied."),

    /**
     * 实名失败
     */
    IDENTITY_VERIFIED_FAILED("Identity verification failed"),
    /**
     * 实名失败-信息缺失
     */
    IDENTITY_VERIFIED_FAILED_MISS_INFO("Identity verification failed", "Missing information", RspEnmu.SYSTEM_SYSDATA_EXCEPTION.getMessage()),
    /**
     * 实名失败-信息缺失
     */
    IDENTITY_VERIFIED_FAILED_MISS_INFO2("Identity verification failed", "Missing information", RspEnmu.REAL_NAME_CHECK_FAILED_BIRTH_PHONE.getMessage()),

    /**
     * 实名失败-风险区
     */
    IDENTITY_VERIFIED_FAILED_RISK_STATES("Identity verification failed", "Risk states", RspEnmu.GPS_CHECK_FAILED.getMessage()),

    /**
     * 实名失败-超龄
     */
    IDENTITY_VERIFIED_FAILED_OVERAGE("Identity verification failed", "Overage", RspEnmu.REAL_NAME_CHECK_FAILED_OVER_AGE.getMessage()),

    /**
     * 实名失败-Okra Account未查得
     */
    IDENTITY_VERIFIED_FAILED_OKRA_ACCOUNT_NOT_FOUND("Identity verification failed", "Okra Account not found"),

    /**
     * 实名失败-网络繁忙
     */
    IDENTITY_VERIFIED_FAILED_NET_BUSY("Identity verification failed", "Network busy",RspEnmu.NETWORK_BUSY.getMessage()),

    /**
     * 实名失败-120s获取验证码
     */
    IDENTITY_VERIFIED_FAILED_120S("Identity verification failed", "120s to get verification code", RspEnmu.SMS_CODE_COUNT_LIMIT.getMessage()),

    /**
     * 实名失败-没有报错
     */
    IDENTITY_VERIFIED_FAILED_NOT_ERR("Identity verification failed", "Null"),

    /**
     * 实名失败-生日错误
     */
    IDENTITY_VERIFIED_FAILED_BIRTH("Identity verification failed", "Date of birth incorrect", RspEnmu.REAL_NAME_CHECK_FAILED_BY_BIRTHDAY.getMessage()),

    /**
     * 实名失败-bvn手机号输入错误
     */
    IDENTITY_VERIFIED_FAILED_BVN_PHONE("Identity verification failed", "BVN phone No. incorrect"),

    /**
     * 实名失败-提供的ACCOUNT和BVN不匹配
     */
    IDENTITY_VERIFIED_FAILED_BVN("Identity verification failed", "BVN Account incorrect", RspEnmu.REAL_NAME_CHECK_FAILED_BY_BVN_2.getMessage()),

    /**
     * 实名失败-姓名错误
     */
    IDENTITY_VERIFIED_FAILED_BVN_NAME("Identity verification failed", "BVN Name incorrect", RspEnmu.REAL_NAME_CHECK_FAILED_BY_NAME.getMessage()),

    /**
     * 实名失败-GPS解析不到
     */
    IDENTITY_VERIFIED_FAILED_GPS("Identity verification failed", "GPS Resolution incorrect", RspEnmu.EXT_API_EXCEPTION_GPS.getMessage()),

    /**
     * 实名失败-Okra Account接口不通
     */
    IDENTITY_VERIFIED_FAILED_NOT_BUY_OKRA_ACCOUNT("Identity verification failed", "Okra Account interface failure", RspEnmu.EXT_API_EXCEPTION_OKRA.getMessage()),

    /**
     * 实名失败-Okra Account未查得
     */
    IDENTITY_VERIFIED_FAILED_OKRA_ACCOUNT_NOT_FIND("Identity verification failed", "Okra Account not found", RspEnmu.REAL_NAME_CHECK_FAILED_BY_OKRA.getMessage()),


    /**
     * 实名失败-找不到信息
     */
    IDENTITY_VERIFIED_FAILED_NOT_FOUND("Identity verification failed", "Information not found", RspEnmu.CYC_INFORMATION_NOT_FOUND.getMessage()),

    /**
     * 实名失败-BVN match不匹配
     */
    IDENTITY_VERIFIED_FAILED_BVN_MATCH("Identity verification failed", "BVN match mismatch", RspEnmu.BVN_NOT_EQUALS_ACCOUNT_NUMBER.getMessage()),

    /**
     * 实名失败-接口返回的验证错误
     */
    IDENTITY_VERIFIED_FAILED_API_RES_ERROR("Identity verification failed", "Validation errors returned by the interface", RspEnmu.EXTERNAL_API_RSP_FALSE.getMessage()),


    /**
     * 授信成功-已绑定Account
     * not exist
     */
    CREDIT_APPLICATION_SUCCESS_ACCOUNT_EXISTED("Limit Application Success. un-withdrawal.", "Account bind success"),


    /**
     * 授信成功-未绑定Account
     */
    CREDIT_APPLICATION_SUCCESS_ACCOUNT_NOT_EXIST("Limit Application Success. un-withdrawal.", "Un-bind Account"),

    /**
     * 授信失败-风控拒绝
     */
    CREDIT_APPLICATION_FAILED_RISK_REJECT("Risk Reject"),

    /**
     * 授信失败_非风控规则失败
     */
    CREDIT_APPLICATION_FAILED("Limit Application Failed"),

    /**
     * 提现成功 已绑卡
     */
    LOAN_SUCCEED_BIND_CARD("Withdrawal succeed","Card bind success."),

    /**
     * 提现成功 未绑卡
     */
    LOAN_SUCCEED_NOT_CARD("Withdrawal succeed","Un-bind card."),


    /**
     * 提现拒绝
     */
    LOAN_REJECT("Withdrawal Reject",""),


    /**
     * 提现失败
     */
    LOAN_FAILED("Withdrawal failed",""),

    /**
     * 提现失败-贷款取消
     */
    LOAN_FAILED_WITHDRAWAL_CANCEL("Withdrawal failed", "Withdrawal Cancel"),

    /**
     * 提现失败-系统原因_未找到
     */
    LOAN_FAILED_WITHDRAWAL_NOT_FOUND("Withdrawal failed", "System issue_Not Found"),
    /**
     * 提现失败-系统原因_不能发起
     */
    LOAN_FAILED_WITHDRAWAL_NOT_LAUNCH("Withdrawal failed", "System issue_can't launch"),
    /**
     * 提现失败-系统原因_发生错误
     */
    LOAN_FAILED_WITHDRAWAL_ERR("Withdrawal failed", "Withdrawal Cancel", "System issue_Error"),
    /**
     * 提现失败-账户余额不足
     */
    LOAN_FAILED_WITHDRAWAL_INSUFFICIENT_BALANCE("Withdrawal failed", "Withdrawal Cancel", "Insufficient account balance"),

    /**
     * 还款未再贷
     */
    NOT_WITHDRAW_AFTER_REPAYMENT("No withdraw after repayment","Overdue > 10 days"),

    /**
     * 预留
     */
    DIY("", "");

    private String firstTag;

    private String secondTag;

    private String exceptionMsg;

    /**
     * 授信成功
     */
    public final static String LIMITAPPLICATIONSUCCESS="Limit Application Success. un-withdrawal.";

    /**
     * 未绑定account
     */
    public final static String UNBINDACCOUNT="Un-bind Account";

    UserTagEnum(final String firstTag) {
        this.firstTag = firstTag;
    }

    UserTagEnum(String firstTag, String secondTag) {
        this.firstTag = firstTag;
        this.secondTag = secondTag;
    }

    UserTagEnum(String firstTag, String secondTag, String exceptionMsg) {
        this.firstTag = firstTag;
        this.secondTag = secondTag;
        this.exceptionMsg = exceptionMsg;
    }

    public static UserTagEnum exceptionMapper(String exceptionMsg) {
        if (exceptionMsg != null) {
            for (UserTagEnum b : UserTagEnum.values()) {
                if (exceptionMsg.equals(b.exceptionMsg)) {
                    return b;
                }
            }
        }
        return null;
    }

    public static UserTagEnum getDiy(String firstTag, String secondTag) {
        UserTagEnum userTagEnum = UserTagEnum.DIY;
        userTagEnum.firstTag = firstTag;
        userTagEnum.secondTag = secondTag;
        return userTagEnum;
    }

    public String getFirstTag() {
        return firstTag;
    }

    public String getSecondTag() {
        return secondTag;
    }

    public String getExceptionMsg() {
        return exceptionMsg;
    }

}

